<template>
	<view>
		<view class="anniubankuai">
			<u-row >
				<u-col span="6">
					<view :class="aid==0?'title_hend_x':'title_hend'" @click="xz(0)">物业费</view>
				</u-col>
				<u-col span="6">
					<view :class="aid==1?'title_hend_x':'title_hend'" @click="xz(1)">停车费</view>
				</u-col>
			</u-row>
		</view>
		<view >
			<view class="body_gong" v-if="list" v-for="(o,index) in list" :key="index">
				<view >订单号：{{o.number}}</view>
				<u-line margin="20rpx 0rpx"></u-line>
				<view >标题：{{o.atitle}}</view>
				<u-line margin="20rpx 0rpx"></u-line>
				<view v-if="aid == 0">房屋：{{o.title}}-{{o.unit}}单元-{{o.name}} </view>
				<view v-if="aid == 1">车位：{{o.title}}-{{o.region}}-{{o.name}} </view>
				<u-line margin="20rpx 0rpx"></u-line>
				<view v-if="aid == 0">使用面积：{{o.sarea}} </view>
				<view v-if="aid == 1">车位面积：{{o.area}} </view>
				<u-line margin="20rpx 0rpx"></u-line>
				<view v-if="aid == 0">公摊面积：{{o.garea}} </view>
				<u-line margin="20rpx 0rpx"  v-if="aid == 0"></u-line>
				<view v-if="aid == 0">房主：{{o.yname}} </view>
				<u-line margin="20rpx 0rpx"  v-if="aid == 0"></u-line>
				<view >起止时间：{{o.stime}} </view>
				<u-line margin="20rpx 0rpx"></u-line>
				<view >截至时间：{{o.etime}} </view>
				<u-line margin="20rpx 0rpx"></u-line>
				<view >应缴费用：{{o.pay}} </view>
				<u-line margin="20rpx 0rpx"></u-line>
				<view >备注信息：{{o.remarks==undefined?"":o.remarks}} </view>
				<u-line margin="20rpx 0rpx"></u-line>
				<view class="ys">状态：{{o.status == 1 ? "已交" : "未交"}} </view>
				<u-line margin="20rpx 0rpx" v-if="o.status == 1"></u-line>
				<view  v-if="o.status == 1">实缴费用：{{o.spay}} </view>
				<u-line margin="20rpx 0rpx" v-if="o.status == 1"></u-line>
				<view  v-if="o.status == 1">缴费时间：{{o.jtime}} </view>
				
				
			</view>
			
		</view>
		<view v-if="list.length==0">
			<u-empty marginTop="100"
					text="暂无账单"
			        mode="message"
			        icon="https://shopimges.oss-cn-hangzhou.aliyuncs.com/wuye/xia/nei.png"
			>
			</u-empty>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				
				xia:0,
				aid:0,
				page:1,
				list: []
			}
		},
		onLoad(e) {
			this.list=[];
			this.xia=0;
			this.page=1;
			this.gethome()
		},
		onShow() {
			
		},
		methods: {
			gethome() {
				uni.$u.http.post('Bill/xcxlist', {
					lxid: this.aid,
					page: this.page,
					limit: 10,
					wxid:uni.getStorageSync('userData').uid
				}).then(res => {
					this.list = this.list.concat(res.data);
					if(res.data.length>9){
						this.page=this.page+1;
					}else{
						this.xia=1
					}
			
				})
			},
			xz(e){
				this.aid=e;
				this.list=[];
				this.xia=0;
				this.page=1;
				this.gethome()
			},
			
		},
		onReachBottom(){//do sth
			if(this.xia==0){
				this.gethome()
				
			}
		},
	}
</script>

<style>
	.ys{
		color: red;
	}
</style>